public class Test {
    public static void main(String[] args) {
        int a = 10;
        try {
            System.out.println(10 / a);
            int[] b = null;
            System.out.println(b.length);
        } catch (ArithmeticException e) {
            System.out.println("捕获到了算数异常！");
        } catch (NullPointerException e) {
            e.printStackTrace();
            System.out.println("捕获到了空指针异常！");
        } finally {
            System.out.println("finally被执行了!");
        }
    }

    public static void main1(String[] args) {
        int a = 10;
        if (a == 10) {
            throw new ArithmeticException("a == 10");
        }
    }
}
